package com.woniuxy.carlife.carlifeuserweb.mapper;

import com.woniuxy.carlife.carlifeuserweb.entity.Usercar;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * @author zjq
 * @ClassName:UsercarMapper
 * @Description:
 * @date 2021/4/6 20:02
 **/

public interface UsercarMapper extends BaseMapper<Usercar> {

    /*
     * 功能描述〈保证只有一个默认展示〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/15 0:15
     * @throws
     */

    @Update("UPDATE t_usercar\n" +
            "SET usercar_default=0 \n" +
            "WHERE user_id=#{userId} \n" +
            "AND usercar_default=#{usercarDefault}")
    public Boolean modifydefaultvalue(Integer userId,Integer usercarDefault);

}
